<!-- App.vue -->
<script setup lang="ts">
// useRouter的使用
import { useRouter } from "vue-router";
const router = useRouter();

function jumpFather(){
  // 编程式跳转和传参
  router.push({
    path: "/father",
    query: {
      msg: "hello Vue-Router",
    },
  });
};
</script>

<template>
  <div>
    <router-link to="/">todolist</router-link>
    |
    <router-link to="/father">father</router-link>
  </div>
  <div>
    <van-button type="primary" @click="jumpFather">跳转到father</van-button>
  </div>
  <router-view></router-view>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

